<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>dev: dev/dev/net/TcpConnection.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">dev
   &#160;<span id="projectnumber">0.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_tcp_connection_8hpp_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">TcpConnection.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/******************************************************************************</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Name         : TcpConnection.hpp</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * Author       : 671643387</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Date         : Aug 30, 2015</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * Description  : Tcp连接类</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> *****************************************************************************/</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#ifndef TCPCONNECTION_HPP_INCLUDED</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#define TCPCONNECTION_HPP_INCLUDED</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &lt;boost/shared_ptr.hpp&gt;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;dev/net/SocketEventHandler.hpp&gt;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;dev/net/EventLoop.hpp&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;dev/net/TcpConnectionInputStream.hpp&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;dev/net/TcpConnectionOutputStream.hpp&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacedev.html">dev</a></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;{</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    <span class="keyword">namespace </span>net</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    {</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;        <span class="keyword">class </span>TcpAcceptor;</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;        <span class="keyword">class </span>TcpWorker;</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;        <span class="keyword">class </span>TcpServer;</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;        <span class="keyword">class </span>TcpConnection;</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;        <span class="keyword">typedef</span> boost::shared_ptr&lt;TcpConnection&gt; TcpConnectionPtr;</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;</div>
<div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="classdev_1_1net_1_1_tcp_connection.html">   31</a></span>&#160;        <span class="keyword">class </span><a class="code" href="classdev_1_1net_1_1_tcp_connection.html">TcpConnection</a> : <span class="keyword">public</span> <a class="code" href="classdev_1_1net_1_1_socket_event_handler.html">SocketEventHandler</a></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;        {</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;        <span class="keyword">private</span>:</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;            <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classdev_1_1net_1_1_tcp_acceptor.html">TcpAcceptor</a>;</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;            <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classdev_1_1net_1_1_tcp_worker.html">TcpWorker</a>;</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;            <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classdev_1_1net_1_1_tcp_server.html">TcpServer</a>;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;            <span class="keyword">typedef</span> boost::function&lt;void(TcpConnection&amp;)&gt; PassTcpConnectionRefCB;</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;            <span class="keyword">typedef</span> boost::function&lt;void(TcpConnection&amp;, TcpConnectionInputStream&amp;)&gt; InputTcpMessageCB;</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;            <span class="keyword">enum</span> Status</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;            {</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;                NOTCONNECT,     <span class="comment">// 未连接</span></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;                CONNECT,        <span class="comment">// 已连接</span></div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;                CLOSING,        <span class="comment">// 正在关闭</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;                CLOSED          <span class="comment">// 已经关闭</span></div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;            };</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;            <a class="code" href="classdev_1_1net_1_1_tcp_connection.html#a43ee94855cd5bc5b46e5bb5b3fbb545c">TcpConnection</a>(sock_t sock, <span class="keywordtype">size_t</span> isSize = 1024 * 32,</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;                <span class="keywordtype">size_t</span> osSize = 1024 * 32);</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;            <a class="code" href="classdev_1_1net_1_1_tcp_connection.html#a43ee94855cd5bc5b46e5bb5b3fbb545c">TcpConnection</a>(sock_t sock, boost::shared_array&lt;char&gt; ibuff, boost::shared_array&lt;char&gt; obuff, <span class="keywordtype">size_t</span> isSize,</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;                <span class="keywordtype">size_t</span> osSize);</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;            ~<a class="code" href="classdev_1_1net_1_1_tcp_connection.html">TcpConnection</a>();</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdev_1_1net_1_1_tcp_connection.html#a7169d0396d8b3f9d3bc0bfa651c39f40">handleInput</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdev_1_1net_1_1_tcp_connection.html#ada4e4dc8bcdb148eef20a2b479697bbf">handleOutput</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdev_1_1net_1_1_tcp_connection.html#a5ad0a49140192c8fdd39c1f65b520009">handleException</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdev_1_1net_1_1_tcp_connection.html#ad5d67c0a60a1f2c9816e550e4f110e21">handleClose</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;            <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classdev_1_1net_1_1_tcp_connection.html#aa932cbd22a8ecb67a9ecd386d45cf6a4">handleHeartBeat</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="classdev_1_1net_1_1_tcp_connection.html#a57fe0459b4df287e3bd350b219fe040a">   83</a></span>&#160;            <a class="code" href="classdev_1_1net_1_1_socket.html">Socket</a>&amp; <a class="code" href="classdev_1_1net_1_1_tcp_connection.html#a57fe0459b4df287e3bd350b219fe040a">getSocket</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> sock_; }</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div>
<div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="classdev_1_1net_1_1_tcp_connection.html#aa0a999f61e843d717c53a0601de5b6b6">   89</a></span>&#160;            <a class="code" href="classdev_1_1net_1_1_tcp_connection_input_stream.html">TcpConnectionInputStream</a>&amp; <a class="code" href="classdev_1_1net_1_1_tcp_connection.html#aa0a999f61e843d717c53a0601de5b6b6">getInputStream</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> inputStream_; }</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div>
<div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="classdev_1_1net_1_1_tcp_connection.html#a65525b0c69eab1029c58b8313650c600">   95</a></span>&#160;            <a class="code" href="classdev_1_1net_1_1_tcp_connection_output_stream.html">TcpConnectionOutputStream</a>&amp; <a class="code" href="classdev_1_1net_1_1_tcp_connection.html#a65525b0c69eab1029c58b8313650c600">getOutputStream</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> outputStream_; }</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div>
<div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="classdev_1_1net_1_1_tcp_connection.html#a03fe33106b2b3da08735374a73dc4577">  101</a></span>&#160;            <span class="keywordtype">int</span> <a class="code" href="classdev_1_1net_1_1_tcp_connection.html#a03fe33106b2b3da08735374a73dc4577">getId</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> id_; }</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div>
<div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="classdev_1_1net_1_1_tcp_connection.html#a00d25aa9a45d083c8687cb21b9ddc749">  107</a></span>&#160;            <a class="code" href="classdev_1_1net_1_1_event_loop.html">EventLoop</a>* <a class="code" href="classdev_1_1net_1_1_tcp_connection.html#a00d25aa9a45d083c8687cb21b9ddc749">getLoop</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> eventLoop_; }</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div>
<div class="line"><a name="l00113"></a><span class="lineno"><a class="line" href="classdev_1_1net_1_1_tcp_connection.html#afe7aa2706938bd73520494664c7527f5">  113</a></span>&#160;            Status <a class="code" href="classdev_1_1net_1_1_tcp_connection.html#afe7aa2706938bd73520494664c7527f5">getStatus</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> status_; }</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;        <span class="keyword">public</span>:</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;            <span class="keywordtype">void</span> <a class="code" href="classdev_1_1net_1_1_tcp_connection.html#a61f65d30aed34c170e355ce5841dc1d3">shutdown</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;        <span class="keyword">private</span>:</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;            <span class="keywordtype">void</span> bind(<a class="code" href="classdev_1_1net_1_1_event_loop.html">EventLoop</a>* eventLoop);</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;            <span class="keywordtype">void</span> setId(<span class="keywordtype">int</span> <span class="keywordtype">id</span>) { id_ = id; }</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;            <span class="keywordtype">void</span> setStatus(Status status) { status_ = status; }</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;            <span class="keywordtype">void</span> setServer(TcpServer* server) { server_ = server; }</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        <span class="keyword">private</span>:</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;            <span class="keywordtype">void</span> setMessageCallback(InputTcpMessageCB callback) { onInputMessageCB_ = callback; }</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;            <span class="keywordtype">void</span> setErrorCallback(PassTcpConnectionRefCB callback) { onErrorCB_ = callback; }</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;            <span class="keywordtype">void</span> setClosingCallback(PassTcpConnectionRefCB callback) { closingCB_ = callback; }</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;            <span class="keywordtype">void</span> setHeartBeatCallback(PassTcpConnectionRefCB callback) { onHeartBeatCB_ = callback; }</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;            <span class="keywordtype">void</span> setWritableCallback(PassTcpConnectionRefCB callback) { canWriteCB_ = callback; }</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;        <span class="keyword">private</span>:</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;            <span class="keywordtype">void</span> doError();</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;        <span class="keyword">private</span>:</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;            <span class="keywordtype">int</span> id_;</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;            Status status_;</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;            Socket sock_;</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;            EventLoop* eventLoop_;</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;            TcpServer* server_;</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;            TcpConnectionInputStream inputStream_;</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;            TcpConnectionOutputStream outputStream_;</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;            InputTcpMessageCB onInputMessageCB_;</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;            PassTcpConnectionRefCB onHeartBeatCB_;</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;            PassTcpConnectionRefCB onErrorCB_;</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;            PassTcpConnectionRefCB closingCB_;</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;            PassTcpConnectionRefCB canWriteCB_;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;        };</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    }</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;}</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;<span class="preprocessor">#endif // TCPCONNECTION_HPP_INCLUDED</span></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_connection_html_a00d25aa9a45d083c8687cb21b9ddc749"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_connection.html#a00d25aa9a45d083c8687cb21b9ddc749">dev::net::TcpConnection::getLoop</a></div><div class="ttdeci">EventLoop * getLoop(void) const </div><div class="ttdoc">获取连接绑定到的事件循环 </div><div class="ttdef"><b>Definition:</b> TcpConnection.hpp:107</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_connection_html_ad5d67c0a60a1f2c9816e550e4f110e21"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_connection.html#ad5d67c0a60a1f2c9816e550e4f110e21">dev::net::TcpConnection::handleClose</a></div><div class="ttdeci">virtual void handleClose(void)</div><div class="ttdoc">处理关闭(套接字从反应器移除) </div><div class="ttdef"><b>Definition:</b> TcpConnection.cpp:112</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_connection_html_aa932cbd22a8ecb67a9ecd386d45cf6a4"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_connection.html#aa932cbd22a8ecb67a9ecd386d45cf6a4">dev::net::TcpConnection::handleHeartBeat</a></div><div class="ttdeci">virtual void handleHeartBeat(void)</div><div class="ttdoc">处理心跳 </div><div class="ttdef"><b>Definition:</b> TcpConnection.cpp:118</div></div>
<div class="ttc" id="namespacedev_html"><div class="ttname"><a href="namespacedev.html">dev</a></div><div class="ttdef"><b>Definition:</b> Atomic.hpp:18</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_connection_html_a5ad0a49140192c8fdd39c1f65b520009"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_connection.html#a5ad0a49140192c8fdd39c1f65b520009">dev::net::TcpConnection::handleException</a></div><div class="ttdeci">virtual void handleException(void)</div><div class="ttdoc">处理异常 </div><div class="ttdef"><b>Definition:</b> TcpConnection.cpp:70</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_server_html"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_server.html">dev::net::TcpServer</a></div><div class="ttdef"><b>Definition:</b> TcpServer.hpp:31</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_worker_html"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_worker.html">dev::net::TcpWorker</a></div><div class="ttdef"><b>Definition:</b> TcpWorker.hpp:31</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_connection_html_a43ee94855cd5bc5b46e5bb5b3fbb545c"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_connection.html#a43ee94855cd5bc5b46e5bb5b3fbb545c">dev::net::TcpConnection::TcpConnection</a></div><div class="ttdeci">TcpConnection(sock_t sock, size_t isSize=1024 *32, size_t osSize=1024 *32)</div><div class="ttdoc">Tcp连接构造函数 </div><div class="ttdef"><b>Definition:</b> TcpConnection.cpp:12</div></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_event_handler_html"><div class="ttname"><a href="classdev_1_1net_1_1_socket_event_handler.html">dev::net::SocketEventHandler</a></div><div class="ttdoc">套接字事件处理器 </div><div class="ttdef"><b>Definition:</b> SocketEventHandler.hpp:21</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_connection_html_aa0a999f61e843d717c53a0601de5b6b6"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_connection.html#aa0a999f61e843d717c53a0601de5b6b6">dev::net::TcpConnection::getInputStream</a></div><div class="ttdeci">TcpConnectionInputStream &amp; getInputStream(void)</div><div class="ttdoc">获取连接输入流 </div><div class="ttdef"><b>Definition:</b> TcpConnection.hpp:89</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_connection_html_ada4e4dc8bcdb148eef20a2b479697bbf"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_connection.html#ada4e4dc8bcdb148eef20a2b479697bbf">dev::net::TcpConnection::handleOutput</a></div><div class="ttdeci">virtual void handleOutput(void)</div><div class="ttdoc">处理输出 </div><div class="ttdef"><b>Definition:</b> TcpConnection.cpp:94</div></div>
<div class="ttc" id="classdev_1_1net_1_1_event_loop_html"><div class="ttname"><a href="classdev_1_1net_1_1_event_loop.html">dev::net::EventLoop</a></div><div class="ttdoc">事件循环 </div><div class="ttdef"><b>Definition:</b> EventLoop.hpp:29</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_connection_input_stream_html"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_connection_input_stream.html">dev::net::TcpConnectionInputStream</a></div><div class="ttdoc">Tcp连接输入流 </div><div class="ttdef"><b>Definition:</b> TcpConnectionInputStream.hpp:20</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_acceptor_html"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_acceptor.html">dev::net::TcpAcceptor</a></div><div class="ttdef"><b>Definition:</b> TcpAcceptor.hpp:27</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_connection_html_a57fe0459b4df287e3bd350b219fe040a"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_connection.html#a57fe0459b4df287e3bd350b219fe040a">dev::net::TcpConnection::getSocket</a></div><div class="ttdeci">Socket &amp; getSocket(void)</div><div class="ttdoc">获取连接套接字 </div><div class="ttdef"><b>Definition:</b> TcpConnection.hpp:83</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_connection_html_a7169d0396d8b3f9d3bc0bfa651c39f40"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_connection.html#a7169d0396d8b3f9d3bc0bfa651c39f40">dev::net::TcpConnection::handleInput</a></div><div class="ttdeci">virtual void handleInput(void)</div><div class="ttdoc">处理输入 </div><div class="ttdef"><b>Definition:</b> TcpConnection.cpp:76</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_connection_html_a61f65d30aed34c170e355ce5841dc1d3"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_connection.html#a61f65d30aed34c170e355ce5841dc1d3">dev::net::TcpConnection::shutdown</a></div><div class="ttdeci">void shutdown(void)</div><div class="ttdoc">关闭连接 </div><div class="ttdef"><b>Definition:</b> TcpConnection.cpp:50</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_connection_html_afe7aa2706938bd73520494664c7527f5"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_connection.html#afe7aa2706938bd73520494664c7527f5">dev::net::TcpConnection::getStatus</a></div><div class="ttdeci">Status getStatus(void) const </div><div class="ttdoc">获取连接状态 </div><div class="ttdef"><b>Definition:</b> TcpConnection.hpp:113</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_connection_html_a03fe33106b2b3da08735374a73dc4577"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_connection.html#a03fe33106b2b3da08735374a73dc4577">dev::net::TcpConnection::getId</a></div><div class="ttdeci">int getId(void) const </div><div class="ttdoc">获取连接ID </div><div class="ttdef"><b>Definition:</b> TcpConnection.hpp:101</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_connection_html"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_connection.html">dev::net::TcpConnection</a></div><div class="ttdoc">Tcp连接 </div><div class="ttdef"><b>Definition:</b> TcpConnection.hpp:31</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_connection_html_a65525b0c69eab1029c58b8313650c600"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_connection.html#a65525b0c69eab1029c58b8313650c600">dev::net::TcpConnection::getOutputStream</a></div><div class="ttdeci">TcpConnectionOutputStream &amp; getOutputStream(void)</div><div class="ttdoc">获取连接输出流 </div><div class="ttdef"><b>Definition:</b> TcpConnection.hpp:95</div></div>
<div class="ttc" id="classdev_1_1net_1_1_tcp_connection_output_stream_html"><div class="ttname"><a href="classdev_1_1net_1_1_tcp_connection_output_stream.html">dev::net::TcpConnectionOutputStream</a></div><div class="ttdoc">Tcp连接输出流 </div><div class="ttdef"><b>Definition:</b> TcpConnectionOutputStream.hpp:20</div></div>
<div class="ttc" id="classdev_1_1net_1_1_socket_html"><div class="ttname"><a href="classdev_1_1net_1_1_socket.html">dev::net::Socket</a></div><div class="ttdoc">套接字 </div><div class="ttdef"><b>Definition:</b> Socket.hpp:23</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_5fc0168d11760b9445bd29fa15d9290f.html">dev</a></li><li class="navelem"><a class="el" href="dir_1ca75188a6074d2843e8fd5d982c3101.html">dev</a></li><li class="navelem"><a class="el" href="dir_cea828ca1984caf90af75ecf8a99968a.html">net</a></li><li class="navelem"><b>TcpConnection.hpp</b></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.10 </li>
  </ul>
</div>
</body>
</html>
